<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../../../../">
  <title data-ice="title">src/components/editrgrid/EditGrid.spec.js | formiojs</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
  <script src="script/prettify/prettify.js"></script>
  <script src="script/manual.js"></script>
<meta name="description" content="Common js library for client side interaction with &lt;form.io&gt;"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="formiojs"><meta property="twitter:description" content="Common js library for client side interaction with &lt;form.io&gt;"></head>
<body class="layout-container" data-ice="rootContainer">

<header>
  <a href="./">Home</a>
  
  <a href="identifiers.html">Reference</a>
  <a href="source.html">Source</a>
  
  <div class="search-box">
  <span>
    <img src="./image/search.png">
    <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
  </span>
    <ul class="search-result"></ul>
  </div>
<a style="position:relative; top:3px;" href="https://github.com/formio/formio.js"><img width="20px" src="./image/github.png"></a></header>

<nav class="navigation" data-ice="nav"><div>
  <ul>
    
  <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/formio.form.js~FormioForm.html">FormioForm</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/formio.js~Formio.html">Formio</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/formio.pdf.js~FormioPDF.html">FormioPDF</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/formio.wizard.js~FormioWizard.html">FormioWizard</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createForm">createForm</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-formFactory">formFactory</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components">components</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/Components.js~FormioComponents.html">FormioComponents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-Validator">Validator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-FormioComponentsIndex">FormioComponentsIndex</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-address">components/address</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/address/Address.js~AddressComponent.html">AddressComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-address-fixtures">components/address/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-base">components/base</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/base/Base.js~BaseComponent.html">BaseComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-base-fixtures">components/base/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-button">components/button</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/button/Button.js~ButtonComponent.html">ButtonComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-button-fixtures">components/button/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-checkbox">components/checkbox</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/checkbox/Checkbox.js~CheckBoxComponent.html">CheckBoxComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-checkbox-fixtures">components/checkbox/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-columns">components/columns</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/columns/Column.js~ColumnComponent.html">ColumnComponent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/columns/Columns.js~ColumnsComponent.html">ColumnsComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-columns-fixtures">components/columns/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-container">components/container</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/container/Container.js~ContainerComponent.html">ContainerComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-container-fixtures">components/container/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-content">components/content</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/content/Content.js~ContentComponent.html">ContentComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-content-fixtures">components/content/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-currency">components/currency</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/currency/Currency.js~CurrencyComponent.html">CurrencyComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-currency-fixtures">components/currency/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-datagrid">components/datagrid</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/datagrid/DataGrid.js~DataGridComponent.html">DataGridComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-datagrid-fixtures">components/datagrid/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-datetime">components/datetime</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/datetime/DateTime.js~DateTimeComponent.html">DateTimeComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-datetime-fixtures">components/datetime/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-day">components/day</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/day/Day.js~DayComponent.html">DayComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-day-fixtures">components/day/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-editrgrid">components/editrgrid</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/editrgrid/EditGrid.js~EditGridComponent.html">EditGridComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-editrgrid-fixtures">components/editrgrid/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-email">components/email</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/email/Email.js~EmailComponent.html">EmailComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-email-fixtures">components/email/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-fieldset">components/fieldset</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/fieldset/Fieldset.js~FieldsetComponent.html">FieldsetComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-fieldset-fixtures">components/fieldset/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-file">components/file</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/file/File.js~FileComponent.html">FileComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-form">components/form</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/form/Form.js~FormComponent.html">FormComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-form-fixtures">components/form/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-gmap">components/gmap</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/gmap/Gmap.js~GmapComponent.html">GmapComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-gmap-fixtures">components/gmap/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-hidden">components/hidden</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/hidden/Hidden.js~HiddenComponent.html">HiddenComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-hidden-fixtures">components/hidden/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-html">components/html</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/html/HTML.js~HTMLComponent.html">HTMLComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-html-fixtures">components/html/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-number">components/number</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/number/Number.js~NumberComponent.html">NumberComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-number-fixtures">components/number/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-panel">components/panel</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/panel/Panel.js~PanelComponent.html">PanelComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-panel-fixtures">components/panel/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-password">components/password</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/password/Password.js~PasswordComponent.html">PasswordComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-password-fixtures">components/password/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-phonenumber">components/phonenumber</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/phonenumber/PhoneNumber.js~PhoneNumberComponent.html">PhoneNumberComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-phonenumber-fixtures">components/phonenumber/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-radio">components/radio</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/radio/Radio.js~RadioComponent.html">RadioComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-radio-fixtures">components/radio/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-resource">components/resource</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/resource/Resource.js~ResourceComponent.html">ResourceComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-resource-fixtures">components/resource/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-select">components/select</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/select/Select.js~SelectComponent.html">SelectComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-select-fixtures">components/select/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-selectboxes">components/selectboxes</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/selectboxes/SelectBoxes.js~SelectBoxesComponent.html">SelectBoxesComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-selectboxes-fixtures">components/selectboxes/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-signature">components/signature</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/signature/Signature.js~SignatureComponent.html">SignatureComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-signature-fixtures">components/signature/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-survey">components/survey</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/survey/Survey.js~SurveyComponent.html">SurveyComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-survey-fixtures">components/survey/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-table">components/table</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/table/Table.js~TableComponent.html">TableComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-table-fixtures">components/table/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-textarea">components/textarea</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/textarea/TextArea.js~TextAreaComponent.html">TextAreaComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-textarea-fixtures">components/textarea/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-textfield">components/textfield</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/textfield/TextField.js~TextFieldComponent.html">TextFieldComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-textfield-fixtures">components/textfield/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-time">components/time</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/time/Time.js~TimeComponent.html">TimeComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-time-fixtures">components/time/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-unknown">components/unknown</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/unknown/Unknown.js~UnknownComponent.html">UnknownComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-well">components/well</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/components/well/Well.js~WellComponent.html">WellComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#components-well-fixtures">components/well/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#contrib-stripe-checkout">contrib/stripe/checkout</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/contrib/stripe/checkout/StripeCheckout.js~StripeCheckoutComponent.html">StripeCheckoutComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#contrib-stripe-checkout-fixtures">contrib/stripe/checkout/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#contrib-stripe-stripe">contrib/stripe/stripe</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/contrib/stripe/stripe/Stripe.js~StripeComponent.html">StripeComponent</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#contrib-stripe-stripe-fixtures">contrib/stripe/stripe/fixtures</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-component">component</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-components">components</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#providers-storage">providers/storage</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-base64">base64</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-dropbox">dropbox</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-s3">s3</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-url">url</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#utils">utils</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-FormioUtils">FormioUtils</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#utils-jsonlogic">utils/jsonlogic</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-lodashOperators">lodashOperators</a></span></span></li>
</ul>
</div>
</nav>

<div class="content" data-ice="content"><h1 data-ice="title">src/components/editrgrid/EditGrid.spec.js</h1>
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">&apos;use strict&apos;;
import assert from &apos;power-assert&apos;;
import {EditGridComponent} from &apos;./EditGrid&apos;;
import {components as comps} from &apos;./fixtures/index&apos;;
import {Harness} from &apos;../../../test/harness&apos;;
describe(&apos;EditGrid Component&apos;, () =&gt; {
  it(&apos;Should build an empty edit grid component&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(1)&apos;, &apos;Field 1&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(2)&apos;, &apos;Field 2&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;0&apos;);
      Harness.testElements(component, &apos;li.list-group-header&apos;, 1);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 1);
      Harness.testElements(component, &apos;li.list-group-footer&apos;, 0);
      Harness.testElements(component, &apos;div.editRow&apos;, 0);
      Harness.testElements(component, &apos;div.removeRow&apos;, 0);
      Harness.testElements(component, &apos;div.editgrid-add button&apos;, 1);
      assert(component.checkValidity(component.getValue()), &apos;Item should be valid&apos;);
      done();
    });
  });

  it(&apos;Should build an edit grid component&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(1)&apos;, &apos;Field 1&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(2)&apos;, &apos;Field 2&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;0&apos;);
      Harness.testSetGet(component, [
        {
          field1: &apos;good&apos;,
          field2: &apos;foo&apos;
        },
        {
          field1: &apos;good&apos;,
          field2: &apos;bar&apos;
        }
      ]);
      Harness.testElements(component, &apos;li.list-group-header&apos;, 1);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 3);
      Harness.testElements(component, &apos;li.list-group-footer&apos;, 0);
      Harness.testElements(component, &apos;div.editRow&apos;, 2);
      Harness.testElements(component, &apos;div.removeRow&apos;, 2);
      Harness.testElements(component, &apos;div.editgrid-add button&apos;, 1);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(2) div.row div:nth-child(1)&apos;, &apos;good&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(2) div.row div:nth-child(2)&apos;, &apos;foo&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(3) div.row div:nth-child(1)&apos;, &apos;good&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(3) div.row div:nth-child(2)&apos;, &apos;bar&apos;);
      assert(component.checkValidity(component.getValue()), &apos;Item should be valid&apos;);
      done();
    });
  });

  it(&apos;Should add a row when add another is clicked&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      Harness.testElements(component, &apos;li.list-group-item&apos;, 1);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;0&apos;);
      Harness.clickElement(component, &apos;div.editgrid-add button&apos;);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 2);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;0&apos;);
      Harness.clickElement(component, &apos;div.editgrid-add button&apos;);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 3);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;0&apos;);
      assert(!component.checkValidity(component.getValue()), &apos;Item should not be valid&apos;);
      done();
    });
  });

  it(&apos;Should save a new row when save is clicked&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      Harness.testSetGet(component, [
        {
          field1: &apos;good&apos;,
          field2: &apos;foo&apos;
        },
        {
          field1: &apos;good&apos;,
          field2: &apos;bar&apos;
        }
      ]);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 3);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      Harness.clickElement(component, &apos;div.editgrid-add button&apos;);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 4);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      Harness.setInputValue(component, &apos;data[editgrid][2][field1]&apos;, &apos;good&apos;);
      Harness.setInputValue(component, &apos;data[editgrid][2][field2]&apos;, &apos;baz&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-primary&apos;);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 4);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;3&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(4) div.row div:nth-child(1)&apos;, &apos;good&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(4) div.row div:nth-child(2)&apos;, &apos;baz&apos;);
      assert(component.checkValidity(component.getValue()), &apos;Item should be valid&apos;);
      done();
    });
  });

  it(&apos;Should cancel add a row when cancel is clicked&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      Harness.testSetGet(component, [
        {
          field1: &apos;good&apos;,
          field2: &apos;foo&apos;
        },
        {
          field1: &apos;good&apos;,
          field2: &apos;bar&apos;
        }
      ]);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 3);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      Harness.clickElement(component, &apos;div.editgrid-add button&apos;);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 4);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      Harness.setInputValue(component, &apos;data[editgrid][2][field1]&apos;, &apos;good&apos;);
      Harness.setInputValue(component, &apos;data[editgrid][2][field2]&apos;, &apos;baz&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-danger&apos;);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 3);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      assert.equal(component.editRows.length, 2);
      assert(component.checkValidity(component.getValue()), &apos;Item should be valid&apos;);
      done();
    });
  });

  it(&apos;Should delete a row when delete is clicked&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      Harness.testSetGet(component, [
        {
          field1: &apos;good&apos;,
          field2: &apos;foo&apos;
        },
        {
          field1: &apos;good&apos;,
          field2: &apos;bar&apos;
        },
        {
          field1: &apos;good&apos;,
          field2: &apos;baz&apos;
        }
      ]);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;3&apos;);
      Harness.clickElement(component, &apos;li.list-group-item:nth-child(3) div.removeRow&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(2) div.row div:nth-child(1)&apos;, &apos;good&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(2) div.row div:nth-child(2)&apos;, &apos;foo&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(3) div.row div:nth-child(1)&apos;, &apos;good&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(3) div.row div:nth-child(2)&apos;, &apos;baz&apos;);
      assert(component.checkValidity(component.getValue()), &apos;Item should be valid&apos;);
      done();
    });
  });

  it(&apos;Should edit a row when edit is clicked&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      Harness.testSetGet(component, [
        {
          field1: &apos;good&apos;,
          field2: &apos;foo&apos;
        },
        {
          field1: &apos;good&apos;,
          field2: &apos;bar&apos;
        }
      ]);
      Harness.clickElement(component, &apos;li.list-group-item:nth-child(3) div.editRow&apos;);
      Harness.getInputValue(component, &apos;data[editgrid][1][field1]&apos;, &apos;good&apos;);
      Harness.getInputValue(component, &apos;data[editgrid][1][field2]&apos;, &apos;bar&apos;);
      Harness.testElements(component, &apos;div.editgrid-actions div.btn-primary&apos;, 1);
      Harness.testElements(component, &apos;div.editgrid-actions div.btn-danger&apos;, 1);
      assert(!component.checkValidity(component.getValue()), &apos;Item should not be valid&apos;);
      done();
    });
  });

  it(&apos;Should save a row when save is clicked&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      Harness.testSetGet(component, [
        {
          field1: &apos;good&apos;,
          field2: &apos;foo&apos;
        },
        {
          field1: &apos;good&apos;,
          field2: &apos;bar&apos;
        }
      ]);
      Harness.clickElement(component, &apos;li.list-group-item:nth-child(3) div.editRow&apos;);
      Harness.setInputValue(component, &apos;data[editgrid][1][field2]&apos;, &apos;baz&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-primary&apos;);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 3);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(3) div.row div:nth-child(1)&apos;, &apos;good&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(3) div.row div:nth-child(2)&apos;, &apos;baz&apos;);
      assert(component.checkValidity(component.getValue()), &apos;Item should be valid&apos;);
      done();
    });
  });

  it(&apos;Should cancel edit row when cancel is clicked&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      Harness.testSetGet(component, [
        {
          field1: &apos;good&apos;,
          field2: &apos;foo&apos;
        },
        {
          field1: &apos;good&apos;,
          field2: &apos;bar&apos;
        }
      ]);
      Harness.clickElement(component, &apos;li.list-group-item:nth-child(3) div.editRow&apos;);
      Harness.setInputValue(component, &apos;data[editgrid][1][field2]&apos;, &apos;baz&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-danger&apos;);
      Harness.testElements(component, &apos;li.list-group-item&apos;, 3);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(3) div.row div:nth-child(1)&apos;, &apos;good&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(3) div.row div:nth-child(2)&apos;, &apos;bar&apos;);
      assert(component.checkValidity(component.getValue()), &apos;Item should be valid&apos;);
      done();
    });
  });

  it(&apos;Should show error messages for existing data in rows&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      Harness.testSetGet(component, [
        {
          field1: &apos;bad&apos;,
          field2: &apos;foo&apos;
        },
        {
          field1: &apos;good&apos;,
          field2: &apos;bar&apos;
        },
        {
          field1: &apos;also bad&apos;,
          field2: &apos;baz&apos;
        }
      ]);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(2) div.has-error div.editgrid-row-error&apos;, &apos;Must be good&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(4) div.has-error div.editgrid-row-error&apos;, &apos;Must be good&apos;);
      assert(!component.checkValidity(component.getValue()), &apos;Item should not be valid&apos;);
      done();
    });
  });

  it(&apos;Should not allow saving when errors exist&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      document.body.appendChild(component.element);
      Harness.clickElement(component, &apos;div.editgrid-add button&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-primary&apos;);
      Harness.getInputValue(component, &apos;data[editgrid][0][field1]&apos;, &apos;&apos;);
      Harness.getInputValue(component, &apos;data[editgrid][0][field2]&apos;, &apos;&apos;);
      assert(!component.checkValidity(component.getValue()), &apos;Item should not be valid&apos;);
      Harness.setInputValue(component, &apos;data[editgrid][0][field2]&apos;, &apos;baz&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-primary&apos;);
      Harness.getInputValue(component, &apos;data[editgrid][0][field1]&apos;, &apos;&apos;);
      Harness.getInputValue(component, &apos;data[editgrid][0][field2]&apos;, &apos;baz&apos;);
      assert(!component.checkValidity(component.getValue()), &apos;Item should not be valid&apos;);
      Harness.setInputValue(component, &apos;data[editgrid][0][field1]&apos;, &apos;bad&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-primary&apos;);
      Harness.getInputValue(component, &apos;data[editgrid][0][field1]&apos;, &apos;bad&apos;);
      Harness.getInputValue(component, &apos;data[editgrid][0][field2]&apos;, &apos;baz&apos;);
      assert(!component.checkValidity(component.getValue()), &apos;Item should not be valid&apos;);
      Harness.setInputValue(component, &apos;data[editgrid][0][field1]&apos;, &apos;good&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-primary&apos;);
      assert(component.checkValidity(component.getValue()), &apos;Item should be valid&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;1&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(2) div.row div:nth-child(1)&apos;, &apos;good&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-item:nth-child(2) div.row div:nth-child(2)&apos;, &apos;baz&apos;);
      done();
    });
  });

  it(&apos;Should not allow saving when rows are open&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1).then((component) =&gt; {
      Harness.testSetGet(component, [
        {
          field1: &apos;good&apos;,
          field2: &apos;foo&apos;
        },
        {
          field1: &apos;good&apos;,
          field2: &apos;bar&apos;
        }
      ]);
      Harness.clickElement(component, &apos;li.list-group-item:nth-child(3) div.editRow&apos;);
      assert(!component.checkValidity(component.getValue()), &apos;Item should not be valid&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-primary&apos;);
      assert(component.checkValidity(component.getValue()), &apos;Item should be valid&apos;);
      Harness.clickElement(component, &apos;li.list-group-item:nth-child(3) div.editRow&apos;);
      assert(!component.checkValidity(component.getValue()), &apos;Item should not be valid&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-danger&apos;);
      assert(component.checkValidity(component.getValue()), &apos;Item should be valid&apos;);
      done();
    });
  });

  it(&apos;Should disable components when in read only&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp1, {readOnly: true}).then((component) =&gt; {
      Harness.testSetGet(component, [
        {
          field1: &apos;good&apos;,
          field2: &apos;foo&apos;
        },
        {
          field1: &apos;good&apos;,
          field2: &apos;bar&apos;
        }
      ]);
      Harness.clickElement(component, &apos;li.list-group-item:nth-child(3) div.removeRow&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      Harness.clickElement(component, &apos;div.editgrid-add button&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      Harness.clickElement(component, &apos;li.list-group-item:nth-child(3) div.editRow&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-danger&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      Harness.clickElement(component, &apos;li.list-group-item:nth-child(3) div.editRow&apos;);
      Harness.clickElement(component, &apos;div.editgrid-actions div.btn-primary&apos;);
      Harness.testInnerHtml(component, &apos;li.list-group-header div.row div:nth-child(3)&apos;, &apos;2&apos;);
      done();
    });
  });

  it(&apos;Should calculate conditional logic and default values when adding row&apos;, done =&gt; {
    Harness.testCreate(EditGridComponent, comps.comp2).then(component =&gt; {
      Harness.clickElement(component, &apos;div.editgrid-add button&apos;);
      Harness.testVisibility(component, &apos;.formio-component-field2&apos;, false);
      Harness.getInputValue(component, &apos;data[editgrid][0][field1]&apos;, &apos;bar&apos;);
      done();
    });
  });
});
</code></pre>

</div>

<footer class="footer">
  Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
</footer>

<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>
